home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
rjs.lha
/
RJS
/
Transport
/
tests
/
rdaytime.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-14
|
559b
|
27 lines
#include <iostream.h>
#include "RJS/Transport.h"
#include <osfcn.h>
#include <libc.h>
int main(int argc, char *argv[])
{
if (argc!=2) {
cerr << "usage: " << argv[0] << " host" << endl;
exit(1);
}
RJS_InetAddress daytime_address(argv[1],"daytime","udp");
RJS_InetDatagram daytime_server;
daytime_server.active();
daytime_server.sendto("time please",12,daytime_address); // send to server
char buffer[512];
int nbr=daytime_server.recv(buffer,512); // get reply
buffer[nbr]=0;
cout << "rdaytime => " << buffer << endl;
exit(0);
}